//
//  main.c
//  Vector_Math
//
//  Created by John R Peterson on 3/9/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#include "LinAlg.h"
#include "Line.h"
#include "Map.h"
#include "Camera.h"
#include <stdio.h>


int main (int argc, const char * argv[])
{
    //RMap *map = newRMap(1, 7);
    
    float p1[] = {600, 648};    // line 1st
    
    Vec *test = Camera_intersectGround(Vec_create(p1,2));
    Vec_print(test);
    /*
     TODO example for cross product!
    Line *lf = Line_init(vflist);
    
    Vec *heading = Vec_create(p3,2);
    
    Vec *pos = Vec_create(p4,2);
    
    
    printf("forwards");
    Line_print(lf);
    
    Vec *P = Line_perpendicular(lf, pos);
    
    Vec *Z = Vec_crossProductDD(Vec_2Dto3DI(Vec_copy(heading)),Vec_2Dto3DI(Vec_copy(P)));
    
    printf("did that work?");
    Vec_print(Z);*/
    
    
    
    
    

    
        //RMap_drawLine(map,l);
    
   // Matrix_print(map->grid);
    /*
    Matrix *I = Matrix_createZeros(6, 6);
    I->val[0][0] = 1;
    I->val[1][1] = 1;
    I->val[3][5] = 1;
    Matrix_print(I);
    Matrix *C = Matrix_createCircle(2);
    Matrix *R = Matrix_maxConvolveC(I, C);
    Matrix_print(R);*/

    /*
    
    float p3[] = {2, 2};    
    float p4[] = {3, 3};
    
    
    VecList_add(vlist,Vec_create(p3,2));
    VecList_add(vlist,Vec_create(p4,2));
    
    PolyLine *pL = PolyLine_init(vlist);
    
    int i;
    for (i = 0; i < pL->Llist->size; i++) {
        Line *l = pL->Llist->list[i];
        Line_print(l);
    }*/
    
    /*
    Line *l2 = Line_2Point(vlist->list[0], vlist->list[1]);
    printf("points in 2point line");
    int j;
    for (j = 0; j < l2->points->size; j++) {
        Vec_print(l2->points->list[j]);
    }
    printf("centroid at: ");
    Vec_print(l2->centroid);
    printf("direction: ");
    Vec_print(l2->direction);
    
    Line *l = Line_init(vlist);
    printf("points in normal line");
    for (j = 0; j < l->points->size; j++) {
        Vec_print(l->points->list[j]);
    }
    printf("centroid at: ");
    Vec_print(l->centroid);
    printf("direction: ");
    Vec_print(l->direction);*/
    /*
    Line *ltest = Line_2Point(vlist->list[0], vlist->list[1]);
    printf("Points in the line");
    int j;
    for (j = 0; j < ltest->points->size; j++) {
        Vec_print(ltest->points->list[j]);
    }
    printf("sigma = ");
    Matrix_print(ltest->Sigma);
    printf("labmda = ");
    Vec_print(ltest->Lambda);
    printf("centroid at: ");
    Vec_print(ltest->centroid);
    printf("direction: ");
    Vec_print(ltest->direction);*/
     
    //PolyLine* PL = PolyLine_init(vlist);
    /*
    Line *l = PL->Llist[1];
    printf("Points in the line");
    for (j = 0; j < l->points->size; j++) {
        Vec_print(l->points->list[j]);
    }
    printf("sigma = ");
    Matrix_print(l->Sigma);
    printf("labmda = ");
    Vec_print(l->Lambda);
    printf("centroid at: ");
    Vec_print(l->centroid);
    printf("direction: ");
    Vec_print(l->direction);*/
/*
    printf("size = %d\n",PL->size);
    printf("maxsize = %d\n",PL->maxsize);
    
    int i,j;
    for (i = 0; i < PL->size; i++) {
        Line *l = PL->Llist[i];
        printf("points in line %d:",i);
        for (j = 0; j < l->points->size; j++) {
            Vec_print(l->points->list[j]);
        }
        printf("%d centroid at = ",i);
        Vec_print(l->centroid);
        printf("%d direction: ",i);
        Vec_print(l->direction);
    }
    printf("done\n");*/
    return 0;
}

